﻿using System;
using System.Windows.Forms;

namespace Связь_с_БД
{
    public partial class FormOrderAcadem : Form
    {
        public FormOrderAcadem()
        {
            InitializeComponent();
        }

        private void Button1Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && textBox2.Text != "")
            {
                string[] strings = new string[3];
                strings[0] = textBox1.Text;
                strings[1] = "с ";
                strings[1] += dateTimePicker1.Text;
                strings[1] += " по ";
                strings[1] += dateTimePicker2.Text;
                strings[2] = textBox2.Text;
                var f1 = Owner as FormMain;
                if (f1 != null)
                {
                    f1.PrintOrderAcademic(strings);
                    Close();
                }
            }
            else
            {
                MessageBox.Show(@"Не все поля заполнены");
            }
        }
        private void Button2Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
